{extend name="layout:default" /}
{block name="title"}管理员列表{/block}
{block name="content"}
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">管理员信息</h3>
                <div class="box-tools">
                    <a href="{:url('add')}" class="btn btn-primary"> 添加 </a>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tbody>
                    <tr>
                        <th>ID</th>
                        <th>管理员昵称</th>
                        <th>邮箱</th>
                        <th>角色名称</th>
                        <th>创建时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    {volist name="admins" id="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.nickname}</td>
                        <td>{$vo.email}</td>
                        <td>
                            {volist name="groups" id="gr"}
                            {if condition="$vo.id eq 1"}
                            超级管理员
                            {else /}
                                {if condition="$vo.id eq $gr.id"}
                                    {if condition="$gr.status eq 1"}
                                    {$gr.title}
                                    {else /}
                                    角色已被禁用
                                    {/if}
                                {else /}
                                {/if}
                            {/if}
                            {/volist}
                        </td>
                        <td>{:date('Y-m-d H:i:s',$vo.create_at)}</td>
                        <td>{:date('Y-m-d H:i:s',$vo.update_at)}</td>
                        <td>
                            <a title="修改" href="{:url('edit',['id'=>$vo.id])}" class="btn btn-success"><i
                                    class="glyphicon glyphicon-edit"></i></a>
                            {if condition="$vo.id neq 1"}
                            <a title="删除" href="{:url('del',['id'=>$vo.id])}" class="btn btn-danger"><i
                                    class="glyphicon glyphicon-trash"></i></a>
                            {/if}
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                {$admins->render()}
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>
{/block}